bitkeeper revision 1.1159.212.115 (4207c574hv18R_VTm-3a9w_AZzNBWw)
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Mon, 7 Feb 2005 19:45:56 +0000 (19:45 +0000)
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Mon, 7 Feb 2005 19:45:56 +0000 (19:45 +0000)
Force hypercall continuation arguments to size of longs.
Signed-off-by: keir.fraser@cl.cam.ac.uk
xen/arch/x86/domain.c
xen/arch/x86/memory.c
xen/arch/x86/traps.c
xen/common/dom_mem_ops.c
xen/common/multicall.c
xen/include/xen/sched.h

index fa441175cd2d01f455d53bfe2b312a8f75e054f5..150b6e921b745227076da89560f8a4fdda5896ff 100644 (file)
@@ -628,7 +628,7 @@ long do_iopl(domid_t domain, unsigned int new_io_pl)
     return 0;
 }
 
-unsigned long hypercall_create_continuation(
+unsigned long __hypercall_create_continuation(
     unsigned int op, unsigned int nr_args, ...)
 {
     struct mc_state *mcs = &mc_state[smp_processor_id()];
index c532700e3c73d219d267185dab7cd526ffa83d3a..6575f160c7d2718a92ec7cd34b8f5ddf62f0dab1 100644 (file)
@@ -1378,8 +1378,8 @@ int do_mmu_update(
     {
         if ( hypercall_preempt_check() )
         {
-            rc = hypercall_create_continuation(
-                __HYPERVISOR_mmu_update, 3, ureqs, 
+            rc = hypercall3_create_continuation(
+                __HYPERVISOR_mmu_update, ureqs, 
                 (count - i) |
                 (FOREIGNDOM->id << MMU_UPDATE_PREEMPT_FDOM_SHIFT) | 
                 MMU_UPDATE_PREEMPTED, pdone);
index 18f4948608a275186eecc968d83a2dd5c5d0ab33..4cf22f86d79555a3d2eb5ab71cb65dca32942957 100644 (file)
@@ -791,8 +791,8 @@ long do_set_trap_table(trap_info_t *traps)
         if ( hypercall_preempt_check() )
         {
             UNLOCK_BIGLOCK(current->domain);
-            return hypercall_create_continuation(
-                __HYPERVISOR_set_trap_table, 1, traps);
+            return hypercall1_create_continuation(
+                __HYPERVISOR_set_trap_table, traps);
         }
 
         if ( copy_from_user(&cur, traps, sizeof(cur)) ) return -EFAULT;
index 9de62004bae0a85d696ba21dd31aaa3a5085ae50..d5c272e301624e4a7d9e99bb1630f8f0230ebeea 100644 (file)
@@ -25,8 +25,8 @@
 
 #define PREEMPT_CHECK(_op)                          \
     if ( hypercall_preempt_check() )                \
-        return hypercall_create_continuation(       \
-            __HYPERVISOR_dom_mem_op, 5,             \
+        return hypercall5_create_continuation(      \
+            __HYPERVISOR_dom_mem_op,                \
             (_op) | (i << START_EXTENT_SHIFT),      \
             extent_list, nr_extents, extent_order,  \
             (d == current->domain) ? DOMID_SELF : d->id);
index 112a9f31767c63f7286fc2a010c270dd19cd2eb8..1eb3a8cd51deb72c4bc02d57c82da51a41edb3c7 100644 (file)
@@ -67,8 +67,8 @@ long do_multicall(multicall_entry_t *call_list, unsigned int nr_calls)
             if ( i < nr_calls )
             {
                 mcs->flags = 0;
-                return hypercall_create_continuation(
-                    __HYPERVISOR_multicall, 2, &call_list[i], nr_calls-i);
+                return hypercall2_create_continuation(
+                    __HYPERVISOR_multicall, &call_list[i], nr_calls-i);
             }
         }
     }
index 4381799d8908dd693d029470cde392c58f3c3670..75af955c82e0c295d4aebbe503387a7ae5ce88f9 100644 (file)
@@ -262,8 +262,32 @@ int idle_cpu(int cpu); /* Is CPU 'cpu' idle right now? */
 
 void startup_cpu_idle_loop(void);
 
-unsigned long hypercall_create_continuation(
+unsigned long __hypercall_create_continuation(
     unsigned int op, unsigned int nr_args, ...);
+#define hypercall0_create_continuation(_op)                               \
+    __hypercall_create_continuation((_op), 0)
+#define hypercall1_create_continuation(_op, _a1)                          \
+    __hypercall_create_continuation((_op), 1,                             \
+        (unsigned long)(_a1))
+#define hypercall2_create_continuation(_op, _a1, _a2)                     \
+    __hypercall_create_continuation((_op), 2,                             \
+        (unsigned long)(_a1), (unsigned long)(_a2))
+#define hypercall3_create_continuation(_op, _a1, _a2, _a3)                \
+    __hypercall_create_continuation((_op), 3,                             \
+        (unsigned long)(_a1), (unsigned long)(_a2), (unsigned long)(_a3))
+#define hypercall4_create_continuation(_op, _a1, _a2, _a3, _a4)           \
+    __hypercall_create_continuation((_op), 4,                             \
+        (unsigned long)(_a1), (unsigned long)(_a2), (unsigned long)(_a3), \
+        (unsigned long)(_a4))
+#define hypercall5_create_continuation(_op, _a1, _a2, _a3, _a4, _a5)      \
+    __hypercall_create_continuation((_op), 5,                             \
+        (unsigned long)(_a1), (unsigned long)(_a2), (unsigned long)(_a3), \
+        (unsigned long)(_a4), (unsigned long)(_a5))
+#define hypercall6_create_continuation(_op, _a1, _a2, _a3, _a4, _a5, _a6) \
+    __hypercall_create_continuation((_op), 6,                             \
+        (unsigned long)(_a1), (unsigned long)(_a2), (unsigned long)(_a3), \
+        (unsigned long)(_a4), (unsigned long)(_a5), (unsigned long)(_a6))
+
 #define hypercall_preempt_check() \
     (unlikely(softirq_pending(smp_processor_id())))